﻿// -----------------------------------------------------------------------
// <copyright file="CancelClickCommand.cs" company="">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace ModuleCustomerEdit.Commands
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows.Input;
    using Microsoft.Practices.Unity;
    using Microsoft.Practices.Prism.Regions;
    using Microsoft.Practices.ServiceLocation;
    using ShellInfrastructure;
    using ModuleMock.Views;

    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public class CancelClickCommand : ICommand
    {
        [Dependency]
        public IRegionManager RegionManager { get; set; }

        public bool CanExecute(object parameter)
        {
            return true;
        }

        public event EventHandler CanExecuteChanged;

        public void Execute(object parameter)
        {
            RegionManager = ServiceLocator.Current.GetInstance<IRegionManager>();

            IRegion region = RegionManager.Regions[RegionNames.RightRegionName];
            IMockView obj = ServiceLocator.Current.GetInstance<IMockView>();

            region.Activate(obj);
        }
    }
}
